import request from '@/utils/request'
import md5 from 'js-md5'

export function login(username, password) {
  return request({
    url: '/cms/user/login',
    method: 'post',
    data: {
      userName: username,
      password: md5(password)
    }
  })
}

export function getInfo(userId) {
  return request({
    url: '/cms/user/getPriviledge?userId=' + (userId || 0),
    method: 'get',
  })
}

export function logout(userId) {
  return request({
    url: '/cms/user/logout/' + (userId || 0),
    method: 'get'
  })
}
